package com.dao;

import java.util.List;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import com.entity.PriorityEntity;

@Repository
public class PriorityDaoImpl extends GenericDaoImpl<PriorityEntity> implements
		PriorityDao {

	public PriorityEntity getPriorityById(int id) {
		return getById(PriorityEntity.class, id);
	}

	public List<PriorityEntity> getAllPriority() {
		return getAll(PriorityEntity.class);
	}

	public PriorityEntity getPriorityByUniqueId(String id) {
		Query query = sessionFactory.getCurrentSession().createQuery(
				"from PriorityEntity where id=:id");
		query.setParameter("id", id);
		return (PriorityEntity) query.uniqueResult();

	}
}
